<?php
/**
 * Created by PhpStorm.
 * User: user
 * Date: 2018/6/13
 * Time: 23:27
 */

namespace app\index\model;

use think\Model;

class User extends Model
{
    protected $table='user';
    protected $autoWriteTimestamp = true;

    // 定义关联
    public function writednews()
    {
        return $this->hasMany('News','user_id');
    }
    public function newsfavor()
    {
        return $this->belongsToMany('News', 'access');
    }
}
